﻿@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<YAPSAR.Web.Index.IndexModel>
@{
    Layout = "Web/Layout.cshtml";
}

@foreach (var p in Model.Processes)
{
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">@p.ExecutableFilePath</h3>
        </div>
        <div class="panel-body">

            @if (p.Project != null)
            {
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">@p.Project.Name</h3>
                    </div>
                    <div class="panel-body">
                    </div>
                </div>
            }

            @foreach (var t in p.Tags)
            {
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">Tag: @t.Tag.Name</h3>
                    </div>
                    <div class="panel-body">
                    </div>
                </div>
            }

            @foreach (var pi in p.Instances)
            {
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">@pi.WindowTitle</h3>
                    </div>
                    <div class="panel-body">
                        @if (pi.TypedWords.Count > 0)
                        {
                            <ul class="list-group">
                                @foreach (var tw in pi.TypedWords)
                                {
                                    <li class="list-group-item"><span class="badge">@tw.Frequency</span>@tw.Word</li>
                                }
                            </ul>
                        }
                    </div>
                </div>
            }

        </div>
    </div>
}